import http from '@/axios/http.js';
import baseUrl from '@/constant/modelEvaluating/apiUrl.js';
// import mock from '@/mock/api/modelEvaluating/data.js';

const env = import.meta.env.VITE_MODE_NAME;

export default {
	//emojiComment列表查询
	getCommentList(aid,pageDto) {
		if (env == 'development') {
			return http.post(import.meta.env.VITE_API_URL_GATEWAY + baseUrl.comment + aid,pageDto);
		} else if (env == 'test') {
			return http.post(import.meta.env.VITE_API_URL_INFO + baseUrl.comment + aid,pageDto);
		}
	},
	//actions列表
	getActionList(uid){
		if (env == 'development') {
			return http.get(import.meta.env.VITE_API_URL_GATEWAY + baseUrl.actions + uid);
		} else if (env == 'test') {
			return http.get(import.meta.env.VITE_API_URL_INFO + baseUrl.actions + uid);
		}
	},
	//文章列表
	getArticleList(mid){
		if (env == 'development') {
			return http.get(import.meta.env.VITE_API_URL_GATEWAY + baseUrl.article + mid);
		} else if (env == 'test') {
			return http.get(import.meta.env.VITE_API_URL_INFO + baseUrl.article + mid);
		}
	},
	//用户列表
	getUserList(mid){
		if (env == 'development') {
			return http.get(import.meta.env.VITE_API_URL_GATEWAY + baseUrl.userDetail + mid);
		} else if (env == 'test') {
			return http.get(import.meta.env.VITE_API_URL_INFO + baseUrl.userDetail + mid);
		}
	},
	//添加评论
	submitComment(commentDto){
		if (env == 'development') {
			return http.post(import.meta.env.VITE_API_URL_GATEWAY + baseUrl.submitComment,commentDto);
		} else if (env == 'test') {
			return http.post(import.meta.env.VITE_API_URL_INFO + baseUrl.submitComment,commentDto);
		}
	},
	cancelLove(cid,uid){
		if (env == 'development') {
			return http.put(import.meta.env.VITE_API_URL_GATEWAY + baseUrl.cancelLove + cid + '/' + uid);
		} else if (env == 'test') {
			return http.put(import.meta.env.VITE_API_URL_INFO + baseUrl.cancelLove + cid + '/' + uid);
		}
	},
	loveComment(cid,uid){
		if (env == 'development') {
			return http.post(import.meta.env.VITE_API_URL_GATEWAY + baseUrl.addLove + cid + '/' + uid);
		} else if (env == 'test') {
			return http.post(import.meta.env.VITE_API_URL_INFO + baseUrl.addLove + cid + '/' + uid);
		}
	},
	//关注用户功能
	focusUser(fid,uid){
		if (env == 'development') {
			return http.post(import.meta.env.VITE_API_URL_GATEWAY + baseUrl.focusUser + fid + '/' + uid);
		} else if (env == 'test') {
			return http.post(import.meta.env.VITE_API_URL_INFO + baseUrl.focusUser + fid + '/' + uid);
		}
	},
	//收藏文章功能
	saveArticle(aid,uid){
		if (env == 'development') {
			return http.post(import.meta.env.VITE_API_URL_GATEWAY + baseUrl.saveArticle + aid + '/' + uid);
		} else if (env == 'test') {
			return http.post(import.meta.env.VITE_API_URL_INFO + baseUrl.saveArticle + aid + '/' + uid);
		}
	},
	//删除一级评论
	deleteCommentByCid(commentDto){
		if (env == 'development') {
			return http.put(import.meta.env.VITE_API_URL_GATEWAY + baseUrl.deleteCommentByCid,commentDto);
		} else if (env == 'test') {
			return http.put(import.meta.env.VITE_API_URL_INFO + baseUrl.deleteCommentByCid,commentDto);
		}
	},
	//删除二级评论
	deleteChildCommentByCid(commentDto){
		if (env == 'development') {
			return http.put(import.meta.env.VITE_API_URL_GATEWAY + baseUrl.deleteChildCommentByCid,commentDto);
		} else if (env == 'test') {
			return http.put(import.meta.env.VITE_API_URL_INFO + baseUrl.deleteChildCommentByCid,commentDto);
		}
	}
}
